<#import "/layout.html" as c>
    <@c.html title="Index">

    <style type="text/css">
        .mytable {
            color: #333;
            width: 96%;
            margin: 10px;
        }

        .mytable input {
            width: 150px;
            height: auto;
        }

        .mytable .lable {
            text-align: right;
            width: 100px;
            background: #eee;
        }

        .btn {
            padding-top: 1px;
            padding-bottom: 1px;
        }

        .mytable td {
            padding: 5px;
            vertical-align:middle;

        }

        .mytable button {
            float: right;
        }

        tbody {
            padding: 1px;
        }

        select {
            min-width: 120px;
            padding: 3px 8px;
            color: #666;
            border-radius: 5px;
            outline: none;
        }
    </style>

    <!-- 开始用户权限参数 -->
    <@shiro.hasPermission name="sys:user:look">
    <input type="hidden" id="userLook" value="1"/>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:user:type:edit">
    <input type="hidden" id="typeEdit" value="1"/>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:user:agent:edit">
    <input type="hidden" id="userAgentEdit" value="1"/>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:user:offline:recharge">
    <input type="hidden" id="offlineRecharge" value="1"/>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:user:offline:cash">
    <input type="hidden" id="offlineCash" value="1"/>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:user:username:edit">
    <input type="hidden" id="userNameEdit" value="1"/>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:user:realname:edit">
    <input type="hidden" id="realNameEdit" value="1"/>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:user:idcard:edit">
    <input type="hidden" id="idCardEdit" value="1"/>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:user:commission:rate">
    <input type="hidden" id="commissionRateEdit" value="1"/>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:user:invite:edit">
    <input type="hidden" id="inviteEdit" value="1"/>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:user:bank:edit">
    <input type="hidden" id="bankEdit" value="1"/>
    </@shiro.hasPermission>


    <!-- 开始页面内容 -->
    <div id="content" class="content">

        <!-- 开始面包屑导航 -->
        <ol class="breadcrumb pull-right">
            <li><a href="javascript:;">首页</a></li>
            <#list menuState.breadCrumbList as breadCrumb>
                <li class="">${breadCrumb}</li>
            </#list>
        </ol>
        <!-- 结束面包屑导航 -->

        <!-- 开始页头区域 -->
        <h1 class="page-header">用户详情
            <small class="m-l-10">用户详细信息</small>
        </h1>
        <!-- 结束页头区域 -->




        <input id="userId" type="hidden" value="${user.id!}">
        <input id="mobile" type="hidden" value="${user.mobile!}">
        <input id="parentId" type="hidden" value="${user.p.id!'0'}">
        <!-- 基本信息 begin row -->
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-inverse" data-no-drag="true">
                    <div class="panel-heading">
                        <div class="panel-heading-btn"></div>
                        <h4 class="panel-title">基本信息</h4>
                    </div>
                    <div class="panel-body">
                        <div style="position: relative;">
                            <table border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse;"
                                   class="mytable">
                                <tbody>
                                <tr>
                                    <td class="lable">用户ID</td>
                                    <td>${user.id!"0"}</td>
                                    <td class="lable">用户名</td>
                                    <td>
                                        <div class="col-md-9 col-sm-8">
                                            <input type="text" id = "userName" name="userName" value="${user.userName!}" class="form-control" maxlength="15" autocomplete="off" data-tip="tooltip" data-placement="auto"/>
                                        </div>
                                        <button class="btn btn-default btn-s" id="saveUserName">保存</button>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="lable">注册时间</td>
                                    <td>${user.createTime?string('yyyy-MM-dd HH:mm:ss')}</td>
                                    <td class="lable">注册IP</td>
                                    <td>${user.regIp!}</td>
                                </tr>
                                </tbody>
                            </table>

                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- end row -->

        <!-- 资金信息 begin row -->
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-inverse" data-no-drag="true">
                    <div class="panel-heading">
                        <div class="panel-heading-btn"></div>
                        <h4 class="panel-title">资金信息</h4>
                    </div>
                    <div class="panel-body">
                        <div style="position: relative;">
                            <table border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse;"
                                   class="mytable">
                                <tbody>
                                <tr>
                                    <td class="lable">可用金额</td>
                                    <td>${accountModel.available!"0.00"}</td>
                                    <td class="lable">累计入金</td>
                                    <td>
                                        ${accountModel.rechargeSum!"0.00"}
                                        <a data-target='#recharge' id="handRecharge" class='btn btn-s btn-default ' style="float: right" data-toggle='modal'>手动入金</a>
                                    </td>
                                    <td class="lable">累计出金</td>
                                    <td>
                                        ${accountModel.cashSum!"0.00"}
                                        <a data-target='#cash' id="handCash" class='btn btn-s btn-default ' style="float: right" data-toggle='modal'>手动出金</a>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- end row -->

        <!-- 个人信息 begin row -->
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-inverse" data-no-drag="true">
                    <div class="panel-heading">
                        <div class="panel-heading-btn"></div>
                        <h4 class="panel-title">个人信息</h4>
                    </div>
                    <div class="panel-body">
                        <div style="position: relative;">
                            <table border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse;"
                                   class="mytable">
                                <tbody>
                                <tr>
                                    <td class="lable">真实姓名</td>
                                    <td>
                                        <div class="col-md-9 col-sm-8">
                                            <input type="text" id = "realName" name="realName" value="${user.realName!}" class="form-control"  autocomplete="off" data-tip="tooltip" data-placement="auto"/>
                                        </div>
                                        <button class="btn btn-default btn-s" id="saveRealName">保存</button>
                                    </td>
                                    <td class="lable">身份证号</td>
                                    <td>
                                        <div class="col-md-9 col-sm-8">
                                            <input type="text" id = "idCard" name="idCard" value="${user.idCard!}" class="form-control"  autocomplete="off" data-tip="tooltip" data-placement="auto"/>
                                        </div>
                                        <button class="btn btn-default btn-s" id="saveIdCard">保存</button>
                                    </td>
                                    <td  class="lable">手机号</td>
                                    <td id ="showMobile">
                                        ${user.mobileHide!}
                                        <button id="look" class="btn btn-default btn-s">查看</button>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="lable">支付宝账号</td>
                                    <td>${user.alipayAccount!}</td>
                                    <td class="lable">出生日期</td>
                                    <td><#if user.birthday??>${user.birthday?string('yyyy-MM-dd')}</#if></td>
                                    <td class="lable"></td> <td></td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- end row -->

        <!-- 银行卡信息 begin row -->
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-inverse" data-no-drag="true">
                    <div class="panel-heading">
                        <div class="panel-heading-btn"></div>
                        <h4 class="panel-title">银行卡信息</h4>
                    </div>
                    <div class="panel-body">
                        <div id="dtGridContainerBank" class="dt-grid-container"></div>
                    </div>
                </div>
            </div>
        </div>
        <!-- end row -->

        <!-- 登录信息 begin row -->
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-inverse" data-no-drag="true">
                    <div class="panel-heading">
                        <div class="panel-heading-btn"></div>
                        <h4 class="panel-title">登录信息</h4>
                    </div>
                    <div class="panel-body">
                        <div id="dtGridContainerStore" class="dt-grid-container"></div>
                    </div>
                </div>
            </div>
        </div>
        <!-- end row -->

        <!-- 编辑银行卡弹窗开始 -->
        <div class="modal fade" id="editBank" tabindex="-1" role="dialog">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h4 class="modal-title"> 修改银行卡信息 </h4>
                    </div>
                    <div class="modal-body">
                        <form id="editForm" class="form-horizontal form-bordered p-0" autocomplete="off" action="${adminRoot}/userBank/json/edit" method="post" data-parsley-validate="true">
                            <input type="hidden" id="id" name="id"/>
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">银行名称<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                                <div class="col-md-9 col-sm-8">
                                    <select class="form-control selectpicker" id="banks" name="bankCode" data-size="10" data-live-search="true" data-parsley-type="digits" data-style="btn-white">
                                        <#list banks as b>
                                            <option value="${b.insideCode!''}">${b.name!''}</option>
                                        </#list>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">支行名称<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                                <div class="col-md-9 col-sm-8">
                                    <input type="text" name="branch" value="" class="form-control"  autocomplete="off" data-tip="tooltip" data-placement="auto" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">银行卡号<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                                <div class="col-md-9 col-sm-8">
                                    <input type="text" name="bankNo" value="" class="form-control"  maxlength ="20" autocomplete="off" data-tip="tooltip" data-placement="auto"  />
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer"> <a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a> <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="editForm" nc-ajax-submit>确认提交</a> </div>
                </div>
            </div>
        </div>
        <!-- 编辑弹窗结束 -->


        <!-- 手动入金弹窗开始 -->
        <div class="modal fade" id="recharge" tabindex="-1" role="dialog">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h4 class="modal-title"> 手动入金 </h4>
                    </div>
                    <div class="modal-body">
                        <form id="rechargeForm" class="form-horizontal form-bordered p-0" autocomplete="off" action="${adminRoot}/recharge/json/hand" method="post" data-parsley-validate="true">
                            <input id="userIdr" type="hidden" name = "userId" value="${user.id!}">
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">用户名:</label>
                                <div class="col-md-9 col-sm-8">
                                    <input type="text" value="${user.userName!}" class="form-control"  autocomplete="off" data-tip="tooltip" data-placement="auto" readonly="true"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">订单号<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                                <div class="col-md-9 col-sm-8">
                                    <input type="text" name="outOrderNo" value="" class="form-control"  autocomplete="off" data-tip="tooltip" data-placement="auto" data-parsley-validate="true" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">充值金额<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                                <div class="col-md-9 col-sm-8">
                                    <input type="text" name="amount" class="form-control" placeholder="请输入0到100000000之间的数字,保留两位小数" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，输入内容必须是数字。"  data-parsley-required="true" onkeyup = "this.value=/^\d+\.?\d{0,2}$/.test(this.value) ? this.value : this.value.substring(0,this.value.length-1)" data-parsley-range="[0, 100000000]"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">充值来源<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                                <div class="col-md-9 col-sm-8">
                                    <select class="form-control selectpicker" id="typeSource" name="type" data-size="10" data-live-search="true" data-style="btn-white">
                                        <option value="1">快捷支付</option>
                                        <option value="2">支付宝</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">备注<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                                <div class="col-md-9 col-sm-8">
                                    <input type="text" name="remark" value="" class="form-control"  autocomplete="off" data-tip="tooltip" data-placement="auto" />
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer"> <a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a> <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="rechargeForm" nc-ajax-submit>确认提交</a> </div>
                </div>
            </div>
        </div>
        <!-- 手动入金弹窗结束 -->

        <!-- 手动出金弹窗开始 -->
        <div class="modal fade" id="cash" tabindex="-1" role="dialog">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h4 class="modal-title"> 手动出金 </h4>
                    </div>
                    <div class="modal-body">
                        <form id="cashForm" class="form-horizontal form-bordered p-0" autocomplete="off" action="${adminRoot}/cash/json/hand" method="post" data-parsley-validate="true">
                            <input id="userIdc" type="hidden" name = "userId" value="${user.id!}">
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">用户名:</label>
                                <div class="col-md-9 col-sm-8">
                                    <input type="text" value="${user.userName!}" class="form-control"  autocomplete="off" data-tip="tooltip" data-placement="auto" readonly="true"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">订单号<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                                <div class="col-md-9 col-sm-8">
                                    <input type="text" name="outOrderNo" value="" class="form-control"  autocomplete="off" data-tip="tooltip" data-placement="auto" data-parsley-validate="true" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">取出金额<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                                <div class="col-md-9 col-sm-8">
                                    <input type="text" name="amount" class="form-control" placeholder="请输入0到100000000之间的数字,保留两位小数" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，输入内容必须是数字。"  data-parsley-required="true" onkeyup = "this.value=/^\d+\.?\d{0,2}$/.test(this.value) ? this.value : this.value.substring(0,this.value.length-1)" data-parsley-range="[0, 100000000]"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">取出用途<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                                <div class="col-md-9 col-sm-8">
                                    <select class="form-control selectpicker" id="used" name="type" data-size="10" data-live-search="true" data-style="btn-white">
                                        <option value="5">用户取款</option>
                                        <option value="6">结算修改</option>
                                        <option value="7">垫付取回</option>
                                        <option value="8">备用金取回</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-2 col-sm-3">备注<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                                <div class="col-md-9 col-sm-8">
                                    <input type="text" name="remark" value="" class="form-control"  autocomplete="off" data-tip="tooltip" data-placement="auto" />
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer"> <a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a> <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="cashForm" nc-ajax-submit>确认提交</a> </div>
                </div>
            </div>
        </div>
        <!-- 手动出金弹窗结束 -->


    </div>
</@c.html>

<!-- ================== 开始页面级JavaScrip调用 ================== -->
<script src="${pluginsRoot}bootstrap-wizard/js/bwizard.js"></script>
<!-- 表单checkbox项 -->
<script src="${pluginsRoot}bootstrap-switch/bootstrap-switch.min.js"></script>
<!-- 日历控件 -->
<script src="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/WdatePicker.js" defer="defer"></script>
<script src="${jsRoot}user/detail.handle.js"></script>